-
Notifications
You must be signed in to change notification settings - Fork 549
Shared Tree: Persisted Schema Format v2 with persisted metadata support #24590
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
- Added in-memory schema format v2. - Implemented the schema format v2 codec. - Updated test utils that previously assumed there was only one format. - Added snapshots for many of the v2 tests.
…ion as a parameter. - Fixed naming of schema index formats. - Changed schemaChangeFormat to be schema format-agnostic.
…formats. - Moved SchemaCodecVersion.
- Added tests calling schemaFactoryAlpha.
packages/dds/tree/src/feature-libraries/schema-edits/schemaChangeCodecs.ts
Show resolved
Hide resolved
Co-authored-by: Craig Macomber (Microsoft) <42876482+CraigMacomber@users.noreply.github.com>
- Moved JsonCompatibleReadOnly and JsonCompatibleReadOnlyObject to alpha API status so they can be used in schemas - Implemented field factory methods and added test coverage - Added requiredRecursive to schemaFactoryAlpha (not sure if it should be part of this change though)
…involving FormatV2.
…metadata. - Fixed a bug where FormatV2 was including FormatV1 fields. - persistedMetadata is now only written when non-undefined. - simple-tree implementations for individual schema kinds (arrayNode, mapNode, objectNode) now pass persistedMetadata down from the outer factory calls. - Introduced alpha APIs for simple-tree in places where we need to pass persistedMetadata but don't want to pollute the public API. - Updated tests to pass persistedMetadata when constructing SimpleNodeSchemas. - Wrote simple tests for node and field persisted metadata.
const factory = new SchemaFactoryAlpha(""); | ||
|
||
const fooMetadata = { | ||
persistedMetadata: { "a": 2 }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't need to be persistedMetadata
here.
baz: schemaFactory.optionalAlpha(schemaFactory.string, { | ||
persistedMetadata: fooMetadata, | ||
}), | ||
qux: schemaFactory.optionalRecursiveAlpha( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to conform to example usages of the recursive field APIs more closely.
…aredTree.ts weren't copying them in all cases where the needed to, and I was missing SimpleFieldSchema.persistedMetadata. - Added the v5 Shared Tree format and associated snapshots. - Fixed FieldSchemaAlpha.persistedMetadata so it won't return an empty object if the data is undefined.
🔗 No broken links found! ✅ Your attention to detail is admirable. linkcheck output
|
Closing. The changes from this PR ended up in: |
Adds a new Persisted Schema Format with persisted metadata support. This change does not enable it by default.
Changes
Notes for reviewers
Todo
Related PRs